package com.su.sweet.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.su.sweet.model.SysLog;
import com.su.sweet.service.SysLogService;
import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Get;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.annotation.Inject;
import org.noear.solon.core.handle.Result;

@Controller
@Mapping("/syslog")
public class SysLogController {

    @Inject
    private SysLogService sysLogService;

    @Get
    @Mapping("/page")
    public Result page(int pageNum, int pageSize) {
        Page<SysLog> page = new Page<>(pageNum, pageSize);
        return Result.succeed(sysLogService.pageList(page));
    }
}